package org.example.order.model.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.example.misc.model.CommonEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "order_info")
@org.hibernate.annotations.Table(appliesTo = "order_info", comment = "订单表")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class OrderInfo {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false)
    private Long id;
    @Column
    private String orderNo;
    /**
     * 总价。单位 分
     */
    @Column
    private BigDecimal totalPrice;
    /**
     * 购买地址
     */
    @Column
    private String address;
    /**
     * 联系电话
     */
    @Column
    private String relatePhone;
    @Embedded
    private CommonEntity commonEntity;
}
